﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YiSha.Framework;
using YiSha.Util;

namespace YiSha.Entity.OrganizationManage
{
    [Table("SysUser")]
    [SqlSugar.SugarTable("SysUser")]
    public class UserEntity : BaseExtensionEntity
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Description("用户名")]
        [Required(ErrorMessage = "用户名不能为空")]
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "密码不能为空")]
        public string Password { get; set; }
        /// <summary>
        /// 密码盐值
        /// </summary>
        [JsonIgnore]
        public string Salt { get; set; }
        /// <summary>
        /// RealName
        /// </summary>
        [Description("真实姓名")]
        [Required(ErrorMessage = "真实姓名不能为空")]
        public string RealName { get; set; }
        /// <summary>
        /// 性别(0未知 1男 2女)
        /// </summary>
        [Description("性别")]
        public int? Gender { get; set; }
        /// <summary>
        /// 出生日期
        /// </summary>
        public string Birthday { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string Portrait { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [Description("手机号")]
        public string Mobile { get; set; }
        /// <summary>
        /// qq
        /// </summary>
        public string QQ { get; set; }
        /// <summary>
        /// 所属部门Id
        /// </summary>
        [Required(ErrorMessage = "部门不能为空")]
        public string DepartmentId { get; set; }
        /// <summary>
        /// 所属部门上级编号
        /// </summary>
        public string DepartmentIdAll { get; set; }
        /// <summary>
        /// 微信
        /// </summary>
        public string Wechat { get; set; }
        /// <summary>
        /// 登录次数
        /// </summary>
        public int? LoginCount { get; set; }
        /// <summary>
        /// 用户状态(0禁用 1启用)
        /// </summary>
        public int? UserStatus { get; set; }
        /// <summary>
        /// 系统用户(0不是 1是[系统用户拥有所有的权限])
        /// </summary>
        public int? IsSystem { get; set; }
        /// <summary>
        /// 在线(0不是 1是)
        /// </summary>
        public int? IsOnline { get; set; }
        /// <summary>
        /// 首次登录时间
        /// </summary>
        public DateTime? FirstVisit { get; set; }
        /// <summary>
        /// 上一次登录时间
        /// </summary>
        public DateTime? PreviousVisit { get; set; }
        /// <summary>
        /// 最后一次登录时间
        /// </summary>
        public DateTime? LastVisit { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 后台Token
        /// </summary>
        public string WebToken { get; set; }
        /// <summary>
        /// ApiToken
        /// </summary>
        public string ApiToken { get; set; }
    }
}
